/*
 * author      : 吴中勤 
 * date        : 2018/8/19
 * description : TODO
 */

package com.deepexi.adapter.sdk.sap;

public enum SapApiType {
    // BP 相关
    SAP_BP_CREATE("SAP_BP_CREATE", "新建客户"),
    SAP_BP_EXTEND("SAP_BP_EXTEND", "客户扩展"),

    // 订单相关
    SAP_ORDER_CREATE("SAP_ORDER_CREATE", "新建订单"),
    SAP_ORDER_LOCK_VEHICLE("SAP_ORDER_LOCK_VEHICLE", "订单分车"),
    SAP_ORDER_CHANGE_CONSULT("SAP_ORDER_CHANGE_CONSULT", "修改顾问"),
    SAP_ORDER_CHANGE_LOAN("SAP_ORDER_CHANGE_LOAN", "修改金融方案"),
    SAP_ORDER_CHANGE_ASSURANCE("SAP_ORDER_CHANGE_ASSURANCE", "修改保险方案"),

    // 资金相关
    SAP_FUND_FINAL_PAYMENT("SAP_FUND_FINAL_PAYMENT", "尾款"),
    SAP_FUND("SAP_FUND", "财务记账"),
    SAP_REFUND("SAP_REFUND", "订金退款"),

    //
    SAP_CALLBACK("SAP_CALLBACK", "回调接口"),

    // 之前的初步
    BP("SAP_BP", "客户维护"),
    ORDER("SAP_ORDER", "订单维护"),;

    public final String name;
    public final String desc;

    SapApiType(String name, String desc) {
        this.name = name;
        this.desc = desc;
    }

    public static SapApiType fromName(String name) {
        for (SapApiType type : SapApiType.values()) {
            if (type.name.equals(name)) return type;
        }
        return null;
    }

}
